package tools

import (
	"github.com/jinzhu/copier"
)

// 深拷贝
func CopyDeep(toValue interface{}, fromValue interface{}) {
	// body, _ := json.Marshal(fromValue)
	// _ = json.Unmarshal(body, toValue)
	//
	_ = copier.CopyWithOption(toValue, fromValue, copier.Option{
		IgnoreEmpty: false,
		DeepCopy:    true,
		Converters:  nil,
	})
}

// 浅拷贝
func CopyShallow(toValue interface{}, fromValue interface{}) {
	_ = copier.Copy(toValue, fromValue)
}
